import {MATCH_SUCCESS,MATCH_FAIL, MATCH_STATE_RESET} from '../contants/ActionTypes'

const initialState = {
    state:0,//state 0:初始 1:匹配成功 2:匹配失败
    messages:"null"
}

export default function match(state = initialState,action){
    switch(action.type){
    case MATCH_SUCCESS:
        return{
            state:1
        }
    case MATCH_FAIL:
        return{
            state:2,
            messages:action.messages
        }
    case MATCH_STATE_RESET:
        return{
            state:0
        }

    default:
        return state;
    }
}